From d1d87379369e669b7a3e10cea35b609cd9c7e974 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Wed, 28 Apr 2004 15:07:28 +0000 Subject: [PATCH] subpage subtitle shown in monobook now --- includes/Skin.php | 23 +++++++++++++++-------- includes/SkinPHPTal.php | 16 +++++++++------- stylesheets/monobook/IE50Fixes.css | 3 +++ stylesheets/monobook/main.css | 3 +++ 4 files changed, 30 insertions(+), 15 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index 8734b8b9ec..16e57116ca 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -533,17 +533,26 @@ class Skin { function pageSubtitle() { - global $wgOut,$wgTitle,$wgNamespacesWithSubpages; + global $wgOut; $sub = $wgOut->getSubtitle(); if ( "" == $sub ) { global $wgExtraSubtitle; $sub = wfMsg( "fromwikipedia" ) . $wgExtraSubtitle; } + $subpages = $this->subPageSubtitle(); + $sub .= !empty($subpages)?"

$subpages":''; + $s = "

{$sub}

\n"; + return $s; + } + + function subPageSubtitle() + { + global $wgOut,$wgTitle,$wgNamespacesWithSubpages; + $subpages = ''; if($wgOut->isArticle() && !empty($wgNamespacesWithSubpages[$wgTitle->getNamespace()])) { $ptext=$wgTitle->getPrefixedText(); if(preg_match("/\//",$ptext)) { - $sub.="

"; $links=explode("/",$ptext); $c=0; $growinglink=""; @@ -554,19 +563,17 @@ class Skin { $getlink = $this->makeLink( $growinglink, $link ); if(preg_match("/class='new'/i",$getlink)) { break; } # this is a hack, but it saves time if ($c>1) { - $sub .= " | "; + $subpages .= " | "; } else { - $sub .="< "; + $subpages .="< "; } - $sub .= $getlink; + $subpages .= $getlink; $growinglink.="/"; } - } } } - $s = "

{$sub}

\n"; - return $s; + return $subpages; } function nameAndLogin() diff --git a/includes/SkinPHPTal.php b/includes/SkinPHPTal.php index d0152e1926..400222e416 100644 --- a/includes/SkinPHPTal.php +++ b/includes/SkinPHPTal.php @@ -32,19 +32,16 @@ { var $_context = array(); - function set($varName, $value) - { + function set($varName, $value) { $this->_context[$varName] = $value; } - function translate($value) - { + function translate($value) { $value = wfMsg( $value ); - // interpolate variables while (preg_match('/\$([0-9]*?)/sm', $value, $m)) { list($src, $var) = $m; - $varValue = $this->_context[$var]; + $varValue = @$this->_context[$var]; $value = str_replace($src, $varValue, $value); } return $value; @@ -87,7 +84,12 @@ $tpl->set( "pagetitle", $wgOut->getHTMLTitle() ); $tpl->setRef( "thispage", &$this->thispage ); - $tpl->set( "subtitle", $out->getSubtitle() ); + $subpagestr = $this->subPageSubtitle(); + $tpl->set( + "subtitle", !empty($subpagestr)? + ''.$subpagestr.''.$out->getSubtitle(): + $out->getSubtitle() + ); $tpl->set( 'catlinks', $this->getCategories()); if( $wgOut->isSyndicated() ) { $feeds = array(); diff --git a/stylesheets/monobook/IE50Fixes.css b/stylesheets/monobook/IE50Fixes.css index 3c4165aef1..c05361a299 100644 --- a/stylesheets/monobook/IE50Fixes.css +++ b/stylesheets/monobook/IE50Fixes.css @@ -87,6 +87,9 @@ ul#portal-personaltools { white-space: nowrap !important; } +#portlet-contentViews li a:hover { + padding-bottom: 0.5em; +} /* 5.0 doesn't like the background icon for external links and user */ .link-external, .external { diff --git a/stylesheets/monobook/main.css b/stylesheets/monobook/main.css index 6599ee24ff..78746d1b7f 100644 --- a/stylesheets/monobook/main.css +++ b/stylesheets/monobook/main.css @@ -266,6 +266,9 @@ pre { color: #7d7d7d; width: auto; } +span.subpages { + display: block; +} #siteSubtitle { display: none; } -- 2.20.1